<?php

/** 
 * 
 * @author      knight
 * @date        17/5/22
 */
class Jobs extends CI_Controller
{

    function __construct()
    {
        parent::__construct();
        $this->load->database();
    }

    public function index($num = 0, $offset = 20)
    {
        $data = array();
        $where = array(
            'type' => '3'
        ) // type:3,客牛招聘;
;
        $data['lists'] = $this->common_model->list_page('article', $where, $num * $offset, $offset + 1, 'id,title,imgs,create_time', 'id desc');
        $data['title'] = '客牛教程-微信招生教程-微信免费活动-微信砍价教程-商家岛怎么做活动-微信招生怎么做活动';
        
        if (isset($data['lists'][$offset])) {
            $num ++;
            $data['pager'] = "<a class='more fl font14 c64' href='/cases/{($num)}'>下&nbsp;一&nbsp;页</a>";
        } else {
            $data['pager'] = "<a class='more fl font14 c64' >已经是最后一页了</a>";
        }
        
        $this->load->view('course/index', $data);
    }

    function detail($aid = 0)
    {
        // 查找文章
        $art = $this->common_model->getone_where(array(
            'id' => $aid
        ), 'article');
        
        if ($art) {
            $data['art'] = $art;
            $this->load->view('detail', $data);
        } else {
            show_404();
        }
    }
}
